class Solution
{
public:
    int countCompleteDayPairs(vector<int> &hours)
    {
        int result = 0;
        vector<int> m(25, 0);

        for (int hour : hours)
        {
            hour = hour % 24;

            if (hour != 0)
            {
                result += m[24 - hour];
            }
            else
            {
                result += m[0];
            }

            ++m[hour];
        }
        return result;
    }
};